<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
   
    <div id="app">
        <hello></hello>
    </div>
    <template id="hello1">
        <div>{{msg}}<world></world></div>
    </template>
    <template id="world">
        <div>world</div>
    </template>
</body>
</html>
<script src='vue.js'></script>
<script>
    //1.组件三步骤：1.定义组件 2.注册组件 3.使用组件
    let world = {
        template:"#world"
    }
    let hello = {
        template:'#hello1',
        data(){
            return {
                msg:"hello"
            }
        },
        components:{
            world
        }
    }
    let vm = new Vue({
        el:"#app",
        data:{

        },
        components:{
            hello
        }
    })
    
</script>